<section>
	<section>
		<el-button @click="saveOrUpdateDirectory({},{id:''},true)" size="small" icon="el-icon-circle-plus-outline" plain>新增目录</el-button>
		<el-button @click="showEditTree = !showEditTree" size="small" icon="el-icon-edit" type="success" plain>{{showEditTree?"关闭":"开启"}}编辑目录</el-button>
	</section>
	<el-input class="m-t" placeholder="输入关键字进行过滤" v-model="treeFilterText"></el-input>
	<el-tree class="filter-tree m-t" @node-click="nodeClick" @node-expand="nodeExpand" @node-collapse="nodeEollapse" :default-expanded-keys="defaultExpandedKeys" :node-key="defaultProps.nodeKey" :highlight-current="true" :data="data" :props="defaultProps" :filter-node-method="filterNode" :expand-on-click-node="false" ref="tree">
		<span class="custom-tree-node" slot-scope="{node,data}" style="width: 50%;">
			<span class="text-ellipsis" :title="node.label">{{node.label}}</span>
			<span v-show="showEditTree">
				<el-button type="text" size="mini" @click="saveOrUpdateDirectory(node,data,true)" title="添加"><i class="el-icon-circle-plus-outline"></i></el-button>
				<el-button type="text" size="mini" @click="delDirectory(data)" title="删除"><i class="el-icon-delete text-danger"></i></el-button>
				<el-button type="text" size="mini" @click="saveOrUpdateDirectory(node,data,false)" title="修改"><i class="el-icon-edit text-success"></i></el-button>
			</span>
		</span>
	</el-tree>
</section>